<template name="searchCom">
	<view class="searchCom">
		<!-- <image src="../../static/img/ic_search.png"></image> -->
		<u-icon class="searchCom_img" name="search" size="28"></u-icon>
		<input type="text" :placeholder="placeholderStr" v-model="searchComval" @change="searchChange" />
		<view @click="searchClick()">搜索</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchComval:'',
				placeholderStr:'搜索商户名称、商户UID、门店ID'
			}
		},
		props: {
			otherText:''
		},
		mounted:function(){
			if(!!this.otherText){
				this.placeholderStr = this.otherText;
			}
		},
		methods: {
			searchClick:function(){
				this.$emit('searchClick',{searchComval:this.searchComval});
			},
			searchChange:function(){
				this.$emit('searchChange',{searchComval:this.searchComval});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.searchCom{
		position: relative;
		font-size: $uni-font-size-base;
		background-color: #FFFFFF;
		padding: 10rpx 30rpx;
		display: flex;
		align-items: center;
		// image{
		// 	position: absolute;
		// 	left: 40rpx;
		// 	top: 26rpx;
		// 	width: 30rpx;
		// 	height: 30rpx;
		// }
		.searchCom_img{
			position: absolute;
			left: 26rpx;
			top: 28rpx;
			color: #999999;
		}
		input{
			font-size: $uni-font-size-base;
			border-radius: $uni-border-radius-base;
			padding: 10rpx 30rpx;
			background-color: #EEEEEE;
			width: 75%;
			padding-left: 50rpx;
		}
		view{
			margin-left: 20rpx;
		}
	}
</style>
